clear 
cd "C:\Users\selfd\Documents\autopartyinstitutionalization\legacy\cps\replication\data\stata"
use "C:\Users\selfd\Documents\autopartyinstitutionalization\legacy\cps\replication\data\stata\stata_replication.dta"

xtset ccode year

xtpcse v2xps_party i.gwf_prior c.reactive##c.pi1 prior_pi v2x_polyarchy lgdp fsu ussr_sat av_dm, pairwise


* Run the margins command
 margins, dydx (reactive) at (pi1=(0(0.01)1)) saving("margins3.1.dta", replace)
 
 
clear 
use "C:\Users\selfd\Documents\autopartyinstitutionalization\legacy\cps\replication\data\stata\stata_replication.dta"

xtset ccode year

xtpcse v2xps_party i.gwf_prior c.reactive##c.pi1 prior_pi v2x_polyarchy lgdp fsu ussr_sat av_dm, pairwise


* Run the margins command
 margins, dydx(pi1) at(reactive=(0 1)) saving("margins3.2.dta", replace)
 
 
